package com.retail.lottery.colalottery.controller;

import com.retail.lottery.colalottery.annotation.EncryptResponse;
import com.retail.lottery.colalottery.service.CustomerAgreementInfoService;
import com.retail.lottery.colalottery.vo.ResultVO;
import com.retail.lottery.colalottery.vo.request.CustomerAgreementRequest;
import com.retail.lottery.colalottery.vo.request.SaveUserInfoRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/customer-agreement")
@Slf4j
public class CustomerAgreementController {

    @Resource
    private CustomerAgreementInfoService customerAgreementInfoService;
    /**
     * 授权接口
     *
     * @param request
     * @return
     */
    @RequestMapping("/agreement")
    public ResultVO<?> agreement(@Validated @RequestBody CustomerAgreementRequest request){
        return customerAgreementInfoService.agreement(request);
    }


    /**
     * 查询授权信息
     *
     * @param request
     * @return
     */
    @EncryptResponse
    @RequestMapping("/query")
    public ResultVO<?> queryAgreement(@RequestBody CustomerAgreementRequest request){
        return customerAgreementInfoService.queryAgreement(request);
    }
}
